package com.cqndt.disaster.device.controller;

import org.apache.shiro.SecurityUtils;

import com.cqndt.disaster.device.util.DateUtils;
import com.cqndt.disaster.device.vo.TabUserVo;
import org.springframework.beans.factory.annotation.Value;

public abstract class BaseController{
	@Value("${config.offlineTime}")
	private Integer offlineTime;
	
	protected TabUserVo getCurrentUser() {
		Object obj = SecurityUtils.getSubject().getPrincipal();
        return (TabUserVo)obj;
	}
	
	protected Integer getCurrUserId() {
		return getCurrentUser().getId();
	}
	protected String getOfflineTime() {
		return DateUtils.getBeforeHour(offlineTime);
	}
}